package br.com.formulavendas.domainmodel;
// default package

import java.util.List;

import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


/**
 * Perfil entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table (name="perfil")
public class Perfil
		extends EntityBase
		 {


    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// Fields    
	@Id
	@SequenceGenerator(name="perfil_id_seq", sequenceName="perfil_id_seq", allocationSize=1)  
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="perfil_id_seq") 	
     private Integer id;
     private String nome;
     private String descricao;
     
     @Column
     @ElementCollection(targetClass=Usuario.class)
     private List<Usuario> usuarios;


    // Constructors

    /** default constructor */
    public Perfil() {
    }

    
    /** full constructor */
    public Perfil(String nome, String descricao, List<Usuario> usuarios) {
        this.nome = nome;
        this.descricao = descricao;
        this.usuarios = usuarios;
    }

   
    // Property accessors

    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }

    public String getNome() {
        return this.nome;
    }
    
    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getDescricao() {
        return this.descricao;
    }
    
    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public List<Usuario> getUsuarios() {
        return this.usuarios;
    }
    
    public void setUsuarios(List<Usuario> usuarios) {
        this.usuarios = usuarios;
    }


	@Override
	public String toString() {
		return String.format("%s", this.nome.toUpperCase());
	}
   








}